package com.brsanthu.sgwidgets.client;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.widgets.form.DynamicForm;

import static com.brsanthu.sgwidgets.client.ClientUtils.*;

public class SgWidgets implements EntryPoint {

    @Override
    public void onModuleLoad() {

        DualPaneList list = new DualPaneList("Dual Pane List Demo", false, "400", "200");
        List available = new ArrayList();
        available.add("Ganga");
        available.add("Yamuna");
        available.add("Kaveri");
        available.add("Brahmaputra");
        available.add("Narmada");
        available.add("Godavari");
        available.add("Krishna");
        available.add("Mahanadi");
        available.add("Tungabhadra");

        List selected = new ArrayList();
        selected.add("Kaveri");
        selected.add("Krishna");
        selected.add("Tungabhadra");
        list.setData(available, selected);

        DynamicForm form = createForm("100", "100", 2, false);
        form.setFields(new DateTimeFormItem("dateTime", "Date/time Picker"));
        createVLayout(createSpacer(5), createH1Label("Sgwidgets 1.0.0 Demo"), createSpacer(25),
            createH2Label("Date/Time Picker"), form, createH2Label("Dual List Pane"), list).draw();
    }
}
